import request from '@/untils/request'

//展示所有同部门的联系人    ---> 同部门的权限还没有设定
export const selectAllPeople = () => {
    return request({
        url: `/interaction/selectAll`,
        method: "GET",
    })
}

//展示所有任务
export const selectAllTask = () => {
    return request({
        url: `/task/selectAllTask`,
        method: 'GET'
    })
}

//展示登陆者和联系人的对话内容
export const selectMessagesUserConversations = (sender = null, recipient = null) => {
    return request({
        url: `/interaction/messages/conversations`,
        method: 'GET',
        params: {
            sender,
            recipient
        }
    })
}

//交流功能 发送信息的 接口
export const sendMessageByNameAndRecipient = (form) => {
    return request({
        url: `/interaction/sendMessageByNameAndRecipient`,
        method: 'POST',
        data: form,
        // headers: {
        //     'Content-Type': 'multipart/form-data'
        // }
    })
}

//处理发送信息时候上传文件的接口
export const sendSpecialMessage = (data) => {
    return request({
        url: `/message/sendMessageByNameAndRecipient`,
        method: 'POST',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        data:data
    })
}


//聊天内容中 点击 对方发送的文件... 能下载 如何其它格式 比如图片可以点击单独预览
export const download = (id) => {
    return request({
        url: `/message/send/${id}`,
        method: 'GET',
    })
}

